# 使用2层while循环打印三角形
i = 0
"""
*
**
***
"""
# i代表行
while i < 3:
    j = 0
    # j代表列，每次内层循环的上限加以控制
    while j < i + 1:
        print('*', end='')
        j += 1
    print()  # 打印换行
    i += 1
print('=====================================')

"""
*
**
***
"""
for i in range(3):
    for j in range(i + 1):
        print('*', end='')
    print()
print('=====================================')
"""
***
**
*
"""
for i in range(3):
    for j in range(3 - i):
        print('*', end='')
    print()
print('=====================================')
"""
***
 **
  *
"""
for i in range(3):
    for j in range(3):
        if j < i:
            print(' ', end='')  # 界限之前打印空格
        else:
            print('*', end='')  # 界限之后打印*
    print()
print('=====================================')
"""
  *
 **
***
"""
for i in range(3):
    for j in range(3):
        if j < 3 - i - 1:
            print(' ', end='')  # 界限之前打印空格
        else:
            print('*', end='')  # 界限之后打印*
    print()